import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-04-06
 * Time: 16:40
 */
public class test {

    public static void main(String[] args) {
       Scanner scan = new Scanner(System.in);
        System.out.println("请输入你的年龄：");
        int age = scan.nextInt();
        System.out.println("年龄为"+age);


    }

    //找到1-100之间 既是3的倍数，也是5的倍数的所有数字。
    public static void main6(String[] args) {
        for (int i = 1; i <= 100 ; i++) {
            if(i % 3 != 0 || i % 5 != 0){
                continue;
            }
            System.out.println(i);
        }
    }

    //计算1！+2！+3！+4！+5！（1-5的阶乘的和）
    public static void main5(String[] args) {
       int j = 1;
       int total = 0;
        for (j = 1; j <= 5 ; j++) {
            int i = 1;
            int sum = 1;
            while(i <= j){
                sum *= i;
                i++;
            }
            total += sum;
        }
        System.out.println("1-5的阶乘和为" +total);
    }


    //计算5的阶乘
    public static void main4(String[] args) {
        int i = 1;
        int sum = 1;
        while(i <= 6){
            sum *= i;
            i++;
        }
        System.out.println("6的阶乘为"+sum);
    }

    //1-100的偶数和
    public static void main3(String[] args) {
        int i = 2;
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i += 2;
        }
        System.out.println("1-100的奇数和为" + sum);
    }


    //1-100的奇数和
    public static void main2(String[] args) {
        int i = 1;
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i += 2;
        }
        System.out.println("1-100的奇数和为" + sum);
    }


    //1-100的和
    public static void main1(String[] args) {
        int i = 1;
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i++;
        }
        System.out.println("1-100的和为" + sum);
    }
}
